﻿using System;
using System.Windows;

namespace SharpDepend.WPF
{
    /// <summary>
    /// Interaction logic for InputDialog.xaml
    /// </summary>
    public partial class InputDialog : Window
    {
        private DialogInputDialoigCallback mResult;
        private object mParameter;

        public InputDialog(string label, string title, string defaultInput, DialogInputDialoigCallback result, object parameter)
        {
            mResult = result;
            mParameter = parameter;

            InitializeComponent();

            Input.Text = defaultInput;
            Title = title;
            Label.Text = label;
        }

        private void Button_Click(object sender, EventArgs e)
        {
            if (mResult != null)
            {
                mResult(true, Input.Text, mParameter);
            }

            Close();
        }
    }
}
